package com.goblin.model.order.po;

import com.goblin.model.base.BaseEntity;
import lombok.Data;

import javax.persistence.*;

@Data
@Table(name = "t_goods_sku")
@Entity
public class SKU extends BaseEntity {

    @Column(name = "price", columnDefinition = "double(9,2) COMMENT '价格'")
    private Double price;

    @Column(name = "sku_no", columnDefinition = "varchar(255) COMMENT 'sku编号'")
    private String skuNo;

    @Column(name = "sku_name", columnDefinition = "varchar(255) COMMENT 'sku名称'")
    private String skuName;

    @Column(name = "stock", columnDefinition = "int(11) COMMENT '库存'")
    private Integer stock;

    @OneToOne(cascade = CascadeType.MERGE, fetch = FetchType.EAGER)
    @JoinColumn(name = "specVaue_id", referencedColumnName = "id", nullable = false, columnDefinition = " int(11) COMMENT '规格值id'")
    private Brand brand;

}
